FROM python:3.10.10-slim-buster
WORKDIR /app

RUN sed -i "s@http://deb.debian.org@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
RUN apt update
RUN apt-get install libmariadb-dev-compat libmariadb-dev -y
RUN apt install build-essential -y
RUN  pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

#
COPY requirements.txt requirements.txt
RUN  pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

RUN pip3 install uwsgi -i https://pypi.tuna.tsinghua.edu.cn/simple


ADD . ./
RUN chown www-data.www-data ./ -R
RUN python manage.py collectstatic --noinput
EXPOSE 3000
CMD uwsgi ./use.ini
#CMD python manage.py runserver 0.0.0.0:8000